Add Raspberry PICO RP2040 and RP2040_W with ChibiOS#3301
Conversation
|
Important Review skippedToo many files! This PR contains 161 files, which is 11 over the limit of 150. ⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (161)
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds initial ChibiOS support for Raspberry Pi Pico RP2040 boards (Pico + Pico W), including WiFi networking for Pico W via CYW43, plus the build/CI/devcontainer plumbing required to build and package these targets within the nf-interpreter firmware ecosystem.
Changes:
- Add two new ChibiOS target boards:
RP_PICO_RP2040andRP_PICO_W_RP2040, including linker scripts, board files, Kconfig defconfigs, and target glue. - Introduce RP2040 shared target layer (
targets/ChibiOS/_RP2040) for flash/block storage, littlefs, and ADC/SPI/I2C configuration. - Add WiFi support for Pico W (lwIP WiFi thread integration + CYW43 driver FetchContent) and UF2 packaging support (bin→uf2 tool + build/CI updates).
Reviewed changes
Copilot reviewed 168 out of 168 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| targets/ChibiOS/RP_PICO_W_RP2040/targetHAL_Network.cpp | Pico W WiFi-specific network initialization (lwIP + CYW43). |
| targets/ChibiOS/RP_PICO_W_RP2040/target_rng.c | RP2040 ROSC-based RNG stub for ChibiOS RNG API. |
| targets/ChibiOS/RP_PICO_W_RP2040/Target_Network.cpp | Pico W WiFi-backed Target_Network implementation (connect/scan). |
| targets/ChibiOS/RP_PICO_W_RP2040/target_lwipopts.h | Pico W lwIP option overrides (checksums, stacks, IF name). |
| targets/ChibiOS/RP_PICO_W_RP2040/target_lwip_sntp_opts.h | Pico W SNTP startup delay override for no-RTC scenario. |
| targets/ChibiOS/RP_PICO_W_RP2040/target_common.h.in | Pico W memory/feature defines (TLS buffers, RNG flag, TLS1.3 disable). |
| targets/ChibiOS/RP_PICO_W_RP2040/target_common.c | Includes shared RP2040 target_common implementation. |
| targets/ChibiOS/RP_PICO_W_RP2040/target_BlockStorage.c | Includes shared RP2040 BlockStorage implementation. |
| targets/ChibiOS/RP_PICO_W_RP2040/sys_dev_spi_native_target.h | Includes shared RP2040 SPI target header. |
| targets/ChibiOS/RP_PICO_W_RP2040/sys_dev_i2c_native_target.h | Includes shared RP2040 I2C target header. |
| targets/ChibiOS/RP_PICO_W_RP2040/sys_dev_adc_native_target.h | Includes shared RP2040 ADC target header. |
| targets/ChibiOS/RP_PICO_W_RP2040/nanoCLR/target_board.h.in | Pico W nanoCLR target board header template. |
| targets/ChibiOS/RP_PICO_W_RP2040/nanoCLR/RP2040_CLR.ld | Pico W nanoCLR linker script (WiFi flash layout). |
| targets/ChibiOS/RP_PICO_W_RP2040/nanoCLR/RP2040_CLR-DEBUG.ld | Pico W nanoCLR debug linker script. |
| targets/ChibiOS/RP_PICO_W_RP2040/nanoCLR/nanoHAL.cpp | Pico W nanoCLR nanoHAL stub/global. |
| targets/ChibiOS/RP_PICO_W_RP2040/nanoCLR/mcuconf.h | Pico W ChibiOS RP2040 driver configuration (PIO enabled). |
| targets/ChibiOS/RP_PICO_W_RP2040/nanoCLR/mcuconf_nf.h | Pico W nanoFramework MCU overlay (nanoCLR). |
| targets/ChibiOS/RP_PICO_W_RP2040/nanoCLR/main.c | Pico W nanoCLR startup (threads, USB CDC, CLR startup). |
| targets/ChibiOS/RP_PICO_W_RP2040/nanoCLR/halconf_nf.h | Pico W nanoFramework HAL overlay (disable STM32 peripherals). |
| targets/ChibiOS/RP_PICO_W_RP2040/nanoCLR/CMakeLists.txt | Pico W nanoCLR target sources list. |
| targets/ChibiOS/RP_PICO_W_RP2040/nanoBooter/target_board.h.in | Pico W nanoBooter target board header template. |
| targets/ChibiOS/RP_PICO_W_RP2040/nanoBooter/RP2040_booter-DEBUG.ld | Pico W nanoBooter debug linker script. |
| targets/ChibiOS/RP_PICO_W_RP2040/nanoBooter/mcuconf.h | Pico W nanoBooter driver configuration (minimal peripherals). |
| targets/ChibiOS/RP_PICO_W_RP2040/nanoBooter/mcuconf_nf.h | Pico W nanoFramework MCU overlay (nanoBooter). |
| targets/ChibiOS/RP_PICO_W_RP2040/nanoBooter/main.c | Pico W nanoBooter startup and CLR jump validation. |
| targets/ChibiOS/RP_PICO_W_RP2040/nanoBooter/halconf_nf.h | Pico W nanoFramework HAL overlay (nanoBooter). |
| targets/ChibiOS/RP_PICO_W_RP2040/nanoBooter/CMakeLists.txt | Pico W nanoBooter target sources list. |
| targets/ChibiOS/RP_PICO_W_RP2040/mbedtls_entropy_hardware_pool.c | Pico W/RP2040 entropy provider for MbedTLS/PSA. |
| targets/ChibiOS/RP_PICO_W_RP2040/mbedtls_config.h | Pico W target MbedTLS config overrides. |
| targets/ChibiOS/RP_PICO_W_RP2040/defconfig | Pico W Kconfig defconfig (WiFi + networking + littlefs + mbedTLS). |
| targets/ChibiOS/RP_PICO_W_RP2040/common/targetHAL_ConfigurationManager.cpp | Default network/WiFi config blocks for Pico W. |
| targets/ChibiOS/RP_PICO_W_RP2040/common/Device_BlockStorage.c | Pico W flash map for BlockStorage. |
| targets/ChibiOS/RP_PICO_W_RP2040/common/Device_BlockStorage-DEBUG.c | Pico W debug flash map for BlockStorage. |
| targets/ChibiOS/RP_PICO_W_RP2040/common/CMakeLists.txt | Pico W common sources (BlockStorage map + config mgr). |
| targets/ChibiOS/RP_PICO_W_RP2040/CMakePresets.json | Pico W CMake preset wiring to defconfig. |
| targets/ChibiOS/RP_PICO_W_RP2040/CMakeLists.txt | Pico W build definition (CYW43 fetch, PIO LLD, UF2 packaging). |
| targets/ChibiOS/RP_PICO_W_RP2040/board.h | Pico W board header (ChibiOS-generated). |
| targets/ChibiOS/RP_PICO_W_RP2040/board.c | Pico W board init (ChibiOS-generated). |
| targets/ChibiOS/RP_PICO_RP2040/target_common.h.in | Pico (non-W) memory/feature defines. |
| targets/ChibiOS/RP_PICO_RP2040/target_common.c | Includes shared RP2040 target_common implementation. |
| targets/ChibiOS/RP_PICO_RP2040/target_BlockStorage.c | Includes shared RP2040 BlockStorage implementation. |
| targets/ChibiOS/RP_PICO_RP2040/sys_dev_spi_native_target.h | Includes shared RP2040 SPI target header. |
| targets/ChibiOS/RP_PICO_RP2040/sys_dev_i2c_native_target.h | Includes shared RP2040 I2C target header. |
| targets/ChibiOS/RP_PICO_RP2040/sys_dev_adc_native_target.h | Includes shared RP2040 ADC target header. |
| targets/ChibiOS/RP_PICO_RP2040/nanoCLR/target_board.h.in | Pico nanoCLR target board header template. |
| targets/ChibiOS/RP_PICO_RP2040/nanoCLR/RP2040_CLR.ld | Pico nanoCLR linker script. |
| targets/ChibiOS/RP_PICO_RP2040/nanoCLR/RP2040_CLR-DEBUG.ld | Pico nanoCLR debug linker script. |
| targets/ChibiOS/RP_PICO_RP2040/nanoCLR/nanoHAL.cpp | Pico nanoCLR nanoHAL stub/global. |
| targets/ChibiOS/RP_PICO_RP2040/nanoCLR/mcuconf.h | Pico RP2040 driver configuration. |
| targets/ChibiOS/RP_PICO_RP2040/nanoCLR/mcuconf_nf.h | Pico nanoFramework MCU overlay (nanoCLR). |
| targets/ChibiOS/RP_PICO_RP2040/nanoCLR/main.c | Pico nanoCLR startup (USB CDC + littlefs mount). |
| targets/ChibiOS/RP_PICO_RP2040/nanoCLR/halconf_nf.h | Pico nanoFramework HAL overlay (disable STM32 peripherals). |
| targets/ChibiOS/RP_PICO_RP2040/nanoCLR/CMakeLists.txt | Pico nanoCLR target sources list. |
| targets/ChibiOS/RP_PICO_RP2040/nanoBooter/target_board.h.in | Pico nanoBooter target board header template. |
| targets/ChibiOS/RP_PICO_RP2040/nanoBooter/RP2040_booter.ld | Pico nanoBooter linker script. |
| targets/ChibiOS/RP_PICO_RP2040/nanoBooter/RP2040_booter-DEBUG.ld | Pico nanoBooter debug linker script. |
| targets/ChibiOS/RP_PICO_RP2040/nanoBooter/mcuconf.h | Pico nanoBooter driver configuration (minimal peripherals). |
| targets/ChibiOS/RP_PICO_RP2040/nanoBooter/mcuconf_nf.h | Pico nanoFramework MCU overlay (nanoBooter). |
| targets/ChibiOS/RP_PICO_RP2040/nanoBooter/main.c | Pico nanoBooter startup + CLR jump + LED blink. |
| targets/ChibiOS/RP_PICO_RP2040/nanoBooter/halconf_nf.h | Pico nanoFramework HAL overlay (nanoBooter). |
| targets/ChibiOS/RP_PICO_RP2040/nanoBooter/CMakeLists.txt | Pico nanoBooter target sources list. |
| targets/ChibiOS/RP_PICO_RP2040/defconfig | Pico Kconfig defconfig (littlefs, config block, debugger). |
| targets/ChibiOS/RP_PICO_RP2040/common/Device_BlockStorage.c | Pico flash map for BlockStorage. |
| targets/ChibiOS/RP_PICO_RP2040/common/Device_BlockStorage-DEBUG.c | Pico debug flash map for BlockStorage. |
| targets/ChibiOS/RP_PICO_RP2040/common/CMakeLists.txt | Pico common sources (BlockStorage map). |
| targets/ChibiOS/RP_PICO_RP2040/CMakePresets.json | Pico CMake preset wiring to defconfig. |
| targets/ChibiOS/RP_PICO_RP2040/CMakeLists.txt | Pico build definition (RP2040 sources + UF2 packaging). |
| targets/ChibiOS/CMakePresets.json | Registers RP2040 ChibiOS presets at platform level. |
| targets/ChibiOS/CMakeLists.txt | Adds vendor detection (STM32 vs RP) and WiFi/CYW43 integration hooks. |
| targets/ChibiOS/_WiFi/nf_lwipthread_wifi.h | WiFi-aware lwIP thread API surface for CYW43 transport. |
| targets/ChibiOS/_RP2040/target_system_device_spi_config.cpp | Default RP2040 SPI pin mappings. |
| targets/ChibiOS/_RP2040/target_system_device_pwm_config.cpp | RP2040 PWM notes/config placeholder. |
| targets/ChibiOS/_RP2040/target_system_device_i2c_config.cpp | Default RP2040 I2C pin mappings. |
| targets/ChibiOS/_RP2040/target_system_device_adc_config.cpp | RP2040 ADC channel→GPIO mapping table. |
| targets/ChibiOS/_RP2040/target_stubs.cpp | RP2040 target weak stubs placeholder. |
| targets/ChibiOS/_RP2040/target_stubs.c | Weak GPIO init/uninit stubs when GPIO API disabled. |
| targets/ChibiOS/_RP2040/target_storage_config.h | RP2040 storage feature declaration header. |
| targets/ChibiOS/_RP2040/target_littlefs.h | RP2040 littlefs geometry/config for internal flash partition. |
| targets/ChibiOS/_RP2040/target_littlefs.c | RP2040 littlefs read/erase/program via ChibiOS EFL/ROM flash funcs. |
| targets/ChibiOS/_RP2040/target_FileSystem.cpp | Registers littlefs as available FS (I: volume). |
| targets/ChibiOS/_RP2040/target_common.c | RP2040 HAL system config + target configuration globals. |
| targets/ChibiOS/_RP2040/target_BlockStorage.h | RP2040 BlockStorage count definition. |
| targets/ChibiOS/_RP2040/target_BlockStorage.c | Adds RP2040 flash BlockStorage device to list. |
| targets/ChibiOS/_RP2040/Target_BlockStorage_RP2040FlashDriver.h | RP2040 flash driver interface declarations. |
| targets/ChibiOS/_RP2040/Target_BlockStorage_RP2040FlashDriver.c | RP2040 flash driver using ChibiOS flash/EFL APIs + monitor ops. |
| targets/ChibiOS/_RP2040/sys_dev_spi_native_target.h | RP2040 SPI PAL struct + pin config macro. |
| targets/ChibiOS/_RP2040/sys_dev_i2c_native_target.h | RP2040 I2C PAL struct + pin config macro. |
| targets/ChibiOS/_RP2040/sys_dev_adc_native_target.h | RP2040 ADC channel definition types/externs. |
| targets/ChibiOS/_RP2040/sys_dev_adc_native_System_Device_Adc_AdcController.cpp | RP2040 ADC controller native bindings. |
| targets/ChibiOS/_RP2040/sys_dev_adc_native_System_Device_Adc_AdcChannel.cpp | RP2040 ADC channel read/dispose native bindings. |
| targets/ChibiOS/_RP2040/platform_BlockStorage.c | Maps BlockStorage interface vtable to RP2040 flash driver. |
| targets/ChibiOS/_RP2040/common/usbcfg.h | RP2040 USB CDC serial driver selection header. |
| targets/ChibiOS/_RP2040/common/serialcfg.h | RP2040 UART/SIO serial driver selection header. |
| targets/ChibiOS/_nf-overlay/os/hal/include/hal_nf_community.h | Makes STM32 overlay includes conditional; adds RP2040 RNG stubs. |
| targets/ChibiOS/_nanoCLR/targetHAL_Watchdog.c | Adds RP2040/RP2350 watchdog implementation. |
| targets/ChibiOS/_nanoCLR/targetHAL_Time.cpp | Adds software UTC offset for targets without RTC (SNTP-driven). |
| targets/ChibiOS/_nanoCLR/targetHAL_Power.c | Guards STM32 FSMC usage behind defined() checks; minor SCR change. |
| targets/ChibiOS/_nanoCLR/target_platform.h.in | Makes HAL_NF_USE_STM32_CRC configurable per vendor/target. |
| targets/ChibiOS/_nanoCLR/System.Device.Gpio/cpu_gpio.cpp | Adds RP2040/RP2350 GPIO line mapping and open-drain mode macro. |
| targets/ChibiOS/_nanoCLR/CMakeLists.txt | Updates RNG selection logic to explicitly reject RP2040 hardware RNG. |
| targets/ChibiOS/_nanoBooter/WireProtocol_MonitorCommands.c | Abstracts flash write/erase ops for non-STM32 targets. |
| targets/ChibiOS/_include/targetHAL_Watchdog.h | Skips STM32 LSI watchdog requirement checks for RP targets. |
| targets/ChibiOS/_include/TargetHAL_Spi.h | Sets RP targets to 2 SPI buses vs STM32 default. |
| targets/ChibiOS/_include/lwipopts.h | Enables SNTP server DNS names in lwIP options. |
| targets/ChibiOS/_common/WireProtocol_HAL_Interface.c | Allows serialcfg.h inclusion for SIO-based serial. |
| targets/ChibiOS/_common/rules_code.ld | Makes vector table alignment configurable (RP2040 requires 256). |
| targets/ChibiOS/_common/LaunchCLR.c | Sets VTOR when jumping from booter to CLR (incl. RP2040 fallback). |
| targets/ChibiOS/_common/hard_fault_handler.c | Extends Cortex-M0 handler selection to RP2040 and updates error msg. |
| targets/ChibiOS/_common/CMakeLists.txt | Makes block storage driver inclusion vendor-conditional. |
| src/PAL/Events/nanoPAL_Events.cpp | Adds CM0+ atomic-lock path for events. |
| src/PAL/COM/sockets/ssl/MbedTLS/ssl_write_internal.cpp | Removes commented debug print line. |
| src/PAL/COM/sockets/ssl/MbedTLS/ssl_read_internal.cpp | Improves handling of WANT_READ/WANT_WRITE and close-notify cases. |
| src/PAL/COM/sockets/ssl/MbedTLS/ssl_generic_init_internal.cpp | TLS version defaulting based on build + sets read timeout. |
| src/PAL/COM/sockets/ssl/MbedTLS/ssl_connect_internal.cpp | Avoids recv-timeout callback to prevent keep-alive blocking. |
| src/PAL/COM/sockets/ssl/MbedTLS/nf_mbedtls_config.h | Allows disabling TLS 1.3 via NF_MBEDTLS_DISABLE_TLS_1_3. |
| src/HAL/nanoHAL_SystemEvents.c | Extends CM0 lock path to CM0+ and adjusts atomics usage. |
| src/CLR/Debugger/Debugger.cpp | Minor cleanup; adds (void)msg in erase handler. |
| Kconfig.features | Adds TARGET_HAS_WIFI Kconfig symbol. |
| config/user-tools-repos-ChibiOS-RP.TEMPLATE.json | Adds template for ChibiOS-RP devcontainer tool/repo paths. |
| CMakeLists.txt | Disables HAL MAC for WiFi targets under ChibiOS networking builds. |
| CMake/Scripts/bin2uf2/Program.cs | Adds bin2uf2 tool to generate gap-free merged UF2 images. |
| CMake/Scripts/bin2uf2/bin2uf2.csproj | Project file for bin2uf2 (net8.0). |
| CMake/Modules/FindSystem.Device.Wifi.cmake | Allows target-local overrides by searching ${TARGET_BASE_LOCATION}. |
| CMake/Modules/FindSystem.Device.Spi.cmake | Adds ${TARGET_BASE_LOCATION} include/search paths. |
| CMake/Modules/FindSystem.Device.Pwm.cmake | Adds ${TARGET_BASE_LOCATION} include/search paths. |
| CMake/Modules/FindSystem.Device.I2c.cmake | Adds ${TARGET_BASE_LOCATION} include/search paths. |
| CMake/Modules/FindSystem.Device.Adc.cmake | Adds ${TARGET_BASE_LOCATION} include/search paths. |
| CMake/Modules/FindNF_Network.cmake | Allows target-local overrides by searching ${TARGET_BASE_LOCATION}. |
| CMake/Modules/FindlwIP.cmake | Adds WiFi-specific include/src selection (nf_lwipthread_wifi vs nf_lwipthread). |
| CMake/Modules/FindCYW43_Driver.cmake | Fetch/find module for georgerobotics/cyw43-driver + ChibiOS adapters. |
| CMake/Modules/FindChibiOSnfOverlay.cmake | Makes overlay include/source selection vendor-conditional (ST vs RP). |
| CMake/Modules/CHIBIOS_RP2040_sources.cmake | Adds ChibiOS RP2040 port source selection. |
| CMake/Modules/CHIBIOS_RP2040_GCC_options.cmake | Adds RP2040 GCC compile/link option macros. |
| CMake/binutils.common.cmake | Adds UF2 packaging function; allows target override for entropy source file. |
| CMake/binutils.ChibiOS.cmake | Adds RP series helper; vendor-conditional package/dependency/source wiring. |
| azure-pipelines.yml | Adds CI job matrix for ChibiOS RP targets (Pico + Pico W). |
| azure-pipelines-templates/pack-publish-artifacts.yml | Publishes .uf2 artifacts. |
| azure-pipelines-templates/build-chibios-rp-targets.yml | Adds build template for ChibiOS RP targets (preset-based). |
| .devcontainer/README.md | Documents new ChibiOS-RP devcontainer option. |
| .devcontainer/ChibiOS-RP/Dockerfile.ChibiOS-RP.SRC | Source-built devcontainer for RP targets (ChibiOS master + deps + .NET). |
| .devcontainer/ChibiOS-RP/Dockerfile.ChibiOS-RP | Placeholder/failure Dockerfile until prebuilt image exists. |
| .devcontainer/ChibiOS-RP/devcontainer.json | Devcontainer definition for RP target development. |
| .devcontainer/All/devcontainer.json | Fixes JSON formatting in mounts list. |
josesimoes
left a comment
There was a problem hiding this comment.
WOW! Impressive work. Very happy that we're about to have support for these.
A few comments and requests for changes. To keep consistent patterns across platforms.
Let's discuss further if you want to follow up on any of those.
|
@josesimoes I've opened a new pull request, #3302, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> ***NO_CI***
…into add-pico-chibios
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
@Ellerbach I've opened a new pull request, #3321, to work on those changes. Once the pull request is ready, I'll request review from you. |
Description
Add Raspberry PICO RP2040 and RP2040_W with ChibiOS
Motivation and Context
How Has This Been Tested?
Tested in various configurations
Screenshots
Types of changes
Checklist